const express = require('express');
const bodyParser = require('body-parser');
const routerProduct = require('./router/product');
const routerUser = require('./router/user');
const app = express();

app.use(bodyParser.json());
app.use((req,res,next)=>{
  res.header("Access-Control-Allow-Origin", "http://localhost:8080");
  res.header("Access-Control-Allow-Methods","POST,GET,PUT,DELETE,OPTIONS");
  res.header("Access-Control-Allow-Headers", "Content-Type");
  next();
});
app.use('/product',routerProduct);
app.use('/user',routerUser);
app.listen(3000);